/*
 *  GWGaterEffect.h
 *  GWGlitch
 *
 *  Created by Michael Forrest on 28/02/2008.
 *  Copyright 2008 Grimaceworks. All rights reserved.
 *
 */

#import "GWEffectBase.h"
class GWGaterEffect : public GWEffectBase {
public:
	GWGaterEffect(AUKernelBase * kernel) : GWEffectBase(kernel){
		holdTime = 0.02 * kernel->GetSampleRate(); // 20ms hold time
		decay = 0.9999;
		framesHeldBelowThreshold = 0;
	}
	virtual void 		Process(const Float32		*inSourceP,
								Float32		*inDestP,  
								UInt32 		inFramesToProcess,  
								UInt32		inNumChannels,  
								bool		&ioSilence);
private:
	UInt32 framesHeldBelowThreshold;
	Float32 decay;
	UInt32 holdTime;
};